﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ProjectManagement.Domain.Services;

namespace ProjectManagement.Web.HtmlHelp
{
	public static class SexAndProListHelper
	{
		public static IEnumerable<SelectListItem> SexHelper(this HtmlHelper htmlHelper)
		{
			var ilist = new List<SelectListItem>() { 
					new SelectListItem(){Text="男",Value="true"},
					new SelectListItem(){Text="女",Value="false"},
				};
			return ilist;
		}

		public static IEnumerable<SelectListItem> ProvienceHelper(this HtmlHelper htmlHelper)
		{
 			var proList = new List<SelectListItem>();
				var proviences =(new ProvienceService()).QueryAll();
				proList.Add(new SelectListItem {Text="请选择",Value="0" });
				foreach (var item in proviences)
				{
					proList.Add(new SelectListItem
					{
						Text = item.Name,
						Value = item.ID.ToString()
					});
				}
				return proList;
		}
	}
}